import {ajax,base} from './config'

/**
 * 班组类别
 */
export const getDepartCategoryList= params => {
  // return axios.post(`${base}performanceController.do?getDepartCategoryList`,params);
  return ajax.getMinData({url:'performanceController.do?getDepartCategoryList',params:params})
};
/**
 * 获取任务类别
 */
export  const getTacheType=params=>{
  // return axios.post(`${base}performanceController.do?getTacheType`,params);
  return ajax.getMinData({url:`${base}performanceController.do?getTacheType`,params:params})

}

/**
 * 权重列表
 * @param params
 */
export const getWeightList=params=>{
  // return axios.post(`${base}performanceController.do?getWeightList`,params);
  return ajax.getBigData({url:`${base}performanceController.do?getWeightList`,params:params})
}
/**
 * 版本号
 * @param params
 */
export const getVersionCode=params=>{
  // return axios.post(`${base}performanceController.do?getVersionCode`,params);
  return ajax.getMinData({url:`${base}performanceController.do?getVersionCode`,params:params})

}
/**
 * 保存权重接口
 * @param params
 */
export  const saveWeight=params=>{
  // return axios.post(`${base}performanceController.do?saveWeight`,params);
  return ajax.postData({url:`${base}performanceController.do?saveWeight`,params:params})

}
/**
 * 获取任务标准工分列表
 * @param params
 */
export  const getTacheList=params=>{
  // return axios.post(`${base}performanceController.do?getTacheList`,params);
   return ajax.getBigData({url:'performanceController.do?getTacheList',params:params})
}
/**
 * 搜索任务标准工分列表
 * @param params
 */
// export  const getVersionTacheList=params=>{
//   return axios.post(`${base}performanceController.do?getVersionTacheList.do`,params);
// }

/**
 * 删除权重
 * @param params id
 */
export  const deleteWeight=params=>{
  // return axios.post(`${base}performanceController.do?deleteWeight`,params);
  return ajax.postData({url:`${base}performanceController.do?deleteWeight`,params:params})

}
/**
 * 获取任务类别默认权重
 * @param params id
 */
export  const getDefaultWeight=params=>{
  // return axios.post(`${base}performanceController.do?getDefaultWeight`,params);
  return ajax.getMinData({url:`${base}performanceController.do?getDefaultWeight`,params:params})

}
/**
 * 设置单项任务类别默认权重
 * @param params id
 */
export  const saveDefaultWeight=params=>{
  // return axios.post(`${base}performanceController.do?saveDefaultWeight`,params);
  return ajax.postData({url:`${base}performanceController.do?saveDefaultWeight`,params:params})

}
/**
 * 删除任务分类及工分信息
 * @param params id
 */
export  const deleteTachePoint=params=>{
  // return axios.post(`${base}performanceController.do?deleteTachePoint`,params);
  return ajax.postData({url:`${base}performanceController.do?deleteTachePoint`,params:params})

}
/**
 * 保存／新增任务分类及工分信息
 * @param params id
 */
export  const saveTachePoint=params=>{
  // return axios.post(`${base}performanceController.do?saveTachePoint`,params);
  return ajax.postData({url:`${base}performanceController.do?saveTachePoint`,params:params})

}
/**
 * 获取权重选项默认值
 * @param params weightId
 */
export  const getWeightItemValue=params=>{
  // return axios.post(`${base}performanceController.do?getWeightItemValue`,params);
  return ajax.getMinData({url:`${base}performanceController.do?getWeightItemValue`,params:params})

}
/**
 * 获取系统对应分类
 * @param params weightId
 */
export  const getSysCategory=params=>{
  // return axios.post(`${base}performanceController.do?getSysCategory`,params);
  return ajax.getMinData({url:`${base}performanceController.do?getSysCategory`,params:params})

}
/**
 * 发布版本
 * @param params
 * * **departCategory** 班组类别(必传)
 * **startTime** 生效时间（必传）
 */
export  const deployTachePoint=params=>{
  // return axios.post(`${base}performanceController.do?deployTachePoint`,params);
  return ajax.postData({url:`${base}performanceController.do?deployTachePoint`,params:params})

}
/**
 * 取消发布
 * @param params
 versionCode 要撤销版本版本号
 departCategory 部门分类
 */
export  const cancelDeploy=params=>{
  // return axios.post(`${base}performanceController.do?cancelDeploy`,params);
  return ajax.postData({url:`${base}performanceController.do?cancelDeploy`,params:params})

}
/**
 * 回滚版本
 * @param params
 departCategory 部门分类
 */
export  const backDeploy=params=>{
  // return axios.post(`${base}performanceController.do?backDeploy`,params);
  return ajax.postData({url:`${base}performanceController.do?backDeploy`,params:params})

}
/**
 * 倒出表格
 * @param params
 departCategory 班组类别(必传)
 versionCode 版本号
 */
export  const exportTachePointData=params=>{
  // return axios.post(`${base}performanceController.do?exportTachePointData`,params);
  return ajax.getBigData({url:`${base}performanceController.do?exportTachePointData`,params:params})
}
/**
 * 人员绩效统计列表
 * @param params
 departId 所属部门
 startDate 开始时间
 endDate 结束时间
 */
export  const getUserPerformanceCount=params=>{
  // return axios.post(`${base}performanceController.do?exportTachePointData`,params);
  return ajax.getBigData({url:`${base}performanceController/getUserPerformanceCount.do`,params:params})
}
/**
 * 个人任务详情
 * @param params
 userId 人员id
 startDate 开始时间
 endDate 结束时间
 */
export  const getUserTaskDetail=params=>{
  // return axios.post(`${base}performanceController.do?exportTachePointData`,params);
  return ajax.getBigData({url:`${base}performanceController.do?getUserTaskDetail`,params:params})
}
/**
 * 规范名称统计
 * @param params
 departId 所属部门
 startDate 开始时间
 endDate 结束时间
 */
export  const getTaskTypePerformanceCount=params=>{
  // return axios.post(`${base}performanceController.do?exportTachePointData`,params);
  return ajax.getBigData({url:`${base}performanceController/getTaskTypePerformanceCount.do`,params:params})
}
/**
 * 规范名称统计
 * @param params
 verId 版本id
 departCategory 部门分类
 */
export  const getTacheNameGraph=params=>{
  // return axios.post(`${base}performanceController.do?exportTachePointData`,params);
  return ajax.getBigData({url:`${base}performanceController.do?getTacheNameGraph`,params:params})
}

